//
//  SQLiteManager.h
//  BaseTdkc
//
//  Created by DavidHuang on 16/7/3.
//  Copyright © 2016年 黄栋炜. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "sqlite3.h"
enum errorCodes {
    kDBNotExists,
    kDBFailAtOpen,
    kDBFailAtCreate,
    kDBErrorQuery,
    kDBFailAtClose
};
@interface SQLiteManager : NSObject{
    
    sqlite3 *db; // The SQLite db reference
    NSString *databaseName; // The database name
}

- (id)initWithDatabaseNamed:(NSString *)name;

// SQLite Operations
- (NSError *) openDatabase;
- (NSError *) doQuery:(NSString *)sql;
- (NSError *)doUpdateQuery:(NSString *)sql withParams:(NSArray *)params;
- (NSArray *) getRowsForQuery:(NSString *)sql;
- (NSError *) closeDatabase;
-(NSError*)insertData:(NSString*)sql withParams:(NSArray *)params;
- (NSString *)getDatabaseDump;
-(NSError*)deleteData:(NSString*)sql withParams:(NSArray *)params;
@end
